]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Reset latched levels on string commit on all situations
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 8 Sep 2023 16:51:34 +0000 (18:51 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 8 Sep 2023 19:42:38 +0000 (19:42 +0000)
The _commitAction() paths have early returns, which made resetting the
latched mode inconsistent depending on the paths taken to commit the
string. This made latched modes not return to normal on e.g. Shell
entries.

Make this happen outside the function, and after the only calling
point, so that the level is correctly reset on all situations.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2945>

js/ui/keyboard.js

index e7d0176dc979207c62134194e140676d684f3038..e029d0a7fec1eb0acae2c755945b8b9fd30bcbfb 100644 (file)
@@ -1533,7 +1533,10 @@ export const Keyboard = GObject.registerClass({
 
             if (key.action !== 'modifier') {
                 button.connect('commit', (_actor, keyval, str) => {
-                    this._commitAction(keyval, str);
+                    this._commitAction(keyval, str).then(() => {
+                        if (!this._latched)
+                            this._setActiveLayer(0);
+                    });
                 });
             }
 
@@ -1613,9 +1616,6 @@ export const Keyboard = GObject.registerClass({
                 });
             }
         }
-
-        if (!this._latched)
-            this._setActiveLayer(0);
     }
 
     _previousWordPosition(text, cursor) {